const state = {
  shareVisible: false,
  shareData: {},
  shareType: 0,
  pintuanVisible: false,
  pintuanData: {},
  promotionPintuanVisible: false,
  promotionPintuanList: false,
  bargainVisible: false,
  bargainData: {}
}

const mutations = {
  // 分享的数据
  SET_SHARE_DATA: (state, data) => {
    state.shareType = data.type
    state.shareData = data.data
  },
  // 分享弹窗的状态
  SET_SHARE_VISIBLE: (state, val) => {
    state.shareVisible = val
  },
  // 拼团弹窗的状态
  SET_PINTUAN_VISIBLE: (state, val) => {
    state.pintuanVisible = val
  },
  // 拼团弹窗数据
  SET_PINTUAN_DATA: (state, data) => {
    state.pintuanData = data
  },
  // 活动拼团弹窗的状态
  SET_PROMOTION_PINTUAN_VISIBLE: (state, val) => {
    state.promotionPintuanVisible = val
  },
  // 活动拼团列表
  SET_PROMOTION_PINTUAN_LIST: (state, data) => {
    state.promotionPintuanList = data
  },
  // 砍价状态
  SET_BARGAIN_VISIBLE: (state, val) => {
    state.bargainVisible = val
  },
  // 砍价数据
  SET_BARGAIN_DATA: (state, data) => {
    state.bargainData = data
  }
}

export default {
  namespaced: true,
  state,
  mutations
}
